package com.otitan.la.forest.system.controller;

import com.otitan.la.forest.system.service.AreaService;
import com.otitan.la.forest.system.service.DicService;
import com.otitan.webapp.framework.basepro.model.DataResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description: 定时任务 controller
 * @Author: jiachangsen
 * @CreateDate: 2020/10/19 14:55
 * @UpdateUser: jiachangsen
 * @UpdateDate: 2020/10/19 14:55
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
@Slf4j
@Api(tags = "角色表API", hidden = true)
@RestController
@RequestMapping("/task")
public class TaskController {

    @Autowired
    private DicService dicService;
    @Autowired
    private AreaService areaService;

    @ApiOperation(value = "同步字典")
    @GetMapping("/dic")
    public DataResult dic(){
        dicService.saveToRedis();
        return DataResult.success();
    }
    @ApiOperation(value = "同步行政区划")
    @GetMapping("/area")
    public DataResult area(){
        areaService.saveToRedis();
        return DataResult.success();
    }

}
